package cn.iocoder.yudao.module.train.dal.mysql.payrefundorder;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.train.dal.dataobject.payrefundorder.PayRefundOrderDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.train.controller.admin.payrefundorder.vo.*;

/**
 * 退款订单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PayRefundOrderMapper extends BaseMapperX<PayRefundOrderDO> {

    default PageResult<PayRefundOrderDO> selectPage(PayRefundOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PayRefundOrderDO>()
                .eqIfPresent(PayRefundOrderDO::getTradeSn, reqVO.getTradeSn())
                .eqIfPresent(PayRefundOrderDO::getTradeNo, reqVO.getTradeNo())
                .eqIfPresent(PayRefundOrderDO::getRefundSn, reqVO.getRefundSn())
                .eqIfPresent(PayRefundOrderDO::getPayAmount, reqVO.getPayAmount())
                .eqIfPresent(PayRefundOrderDO::getRefundAmount, reqVO.getRefundAmount())
                .eqIfPresent(PayRefundOrderDO::getWxUserId, reqVO.getWxUserId())
                .betweenIfPresent(PayRefundOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PayRefundOrderDO::getId));
    }

}